import { request } from '../../../request';

//  模切报价单列表接口
export function qecutListApi(params: any) {
  return request({
    url: `/erp/qecut/list`,
    method: 'get',
    params
  });
}

//  模切报价材料清单接口
export function qecutmaterialListApi(params: any) {
  return request({
    url: `/erp/qecutmaterial/list`,
    method: 'get',
    params
  });
}

// 模切报价单材料清单列表接口-主材
export function qecutmaterialZlistApi(params: any) {
  return request({
    url: `/erp/qecutmaterial/zlist`,
    method: 'get',
    params
  });
}

// 模切报价单材料清单列表接口-辅材
export function qecutmaterialFlistApi(params: any) {
  return request({
    url: `/erp/qecutmaterial/flist`,
    method: 'get',
    params
  });
}

//  获取模切报价单列表的某一项
export function qecutOneApi(params: any) {
  return request({
    url: `/erp/qecut/one`,
    method: 'get',
    params
  });
}

//  获取模切报价单详情的下拉列表数据
export function getDitcApi(params: any) {
  return request({
    url: `/erp/qecut/getDitc`,
    method: 'get',
    params
  });
}

// 单个导出模切报价单
export function qecutExportApi(data: any) {
  return request({
    url: `/erp/qecut/export`,
    method: 'post',
    data,
    responseType: 'blob'
  });
}

// 编辑导出单个
export function qecutExportNewApi(data: any) {
  return request({
    url: `/erp/qecut/exportNew`,
    method: 'post',
    data,
    responseType: 'blob'
  });
}

// 多个导出模切报价单
export function qecutExportsApi(data: any) {
  return request({
    url: `/erp/qecut/exports`,
    method: 'post',
    data,
    responseType: 'blob'
  });
}

// 保存模切报价单接口
export function qecutSaveApi(data: any) {
  return request({
    url: `/quote/qtcut/save`,
    method: 'post',
    data,
  });
}

// 模切报价单编辑查询列表接口-报价单
export function qecutQueryListApi(params: any) {
  return request({
    url: `/quote/qtcut/list`,
    method: 'get',
    params,
  });
}

// 模切报价单编辑查询单条数据查询-材料清单
// export function qecutQueryOneApi(data: any) {
//   return request({
//     url: `/quote/qtcut/one`,
//     method: 'get',
//     data,
//   });
// }

// 模切报价单编辑查询单条数据查询-材料清单
export function getQecutOneApi(params: any) {
  return request({
    url: `/erp/qecut/getOne`,
    method: 'get',
    params
  });
}

// 模切报价单编辑查询单条数据明细
export function getOneDetailsApi(params: any) {
  return request({
    url: `/quote/qtcut/one`,
    method: 'get',
    params
  });
}

// 模切报价单模板配置保存接口
export function dieCuttingConfigurationSaveApi(data: any) {
  return request({
    url: `/quote/template/save`,
    method: 'post',
    data,
  });
}

// 模切报价单板配置编辑
export function dieCuttingConfigurationEditApi(data: any) {
  return request({
    url: `/quote/template/edit`,
    method: 'post',
    data,
  });
}

// 模切报价单模板配置列表接口
export function dieCuttingConfigurationListApi(params: any) {
  return request({
    url: `/quote/template/list`,
    method: 'get',
    params
  });
}

// 模切报价单模板配置删除接口
export function dieCuttingConfigurationRemoveApi(userIds: any) {
  return request({
    url: `/quote/template/remove/${userIds}`,
    method: 'delete',
  });
}

// 模切报价单模板配置输入客户代码，带出客户名称接口
export function getCustInfo(params: any) {
  return request({
    url: `/erp/qecut/getCustInfo`,
    method: 'get',
    params
  });
}

// 编辑提交审核接口
export function dieCuttingEditSubmit(data: any) {
  return request({
    url: `/quote/qtcut/submitCheck`,
    method: 'put',
    data
  });
}

// 编辑列表提交审核接口
export function dieCuttingListSubmit(data: any) {
  return request({
    url: `/quote/qtcut/check`,
    method: 'post',
    data
  });
}

// 编辑版本升级接口
export function dieCuttingUpgradeSubmit(data: any) {
  return request({
    url: `/quote/qtcut/upgrade`,
    method: 'post',
    data
  });
}
